﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.Library;
using System.Data;
using IHISCETeim.BLL;
using System.Text;

namespace IHISCETeim.Web.MachineSys.FTradeModel
{
    public partial class Report7FTrade : EasyUIPageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.查看 };
            }
        }
        protected override string DWZRef
        {
            get
            {
                return "Report7FTrade";
            }
        }
        protected string lastDaoQiRi
        {
            get
            {
                DateTime dt = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);

                return dt.AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");

            }
        }



        protected override string query()
        {

            //营业经理权限 2014-02-21
            string agentList = base.FTradeAgentPowerSqlWhere();
            string wheresql = string.IsNullOrEmpty(agentList) ? " 1=1 " : string.Format(" JingXiaoShang in ({0})", agentList);

            DataTableCollection dts = FTradeReportController.Report7GetReportDate(wheresql,lastDaoQiRi);


            return ToDataGridJson(dts[0], TotalCount, dts[1]).ToString();
        }
    }
}